package com.wxq.demo.controller;

import com.wxq.demo.bean.Author;
import com.wxq.demo.bean.Book;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class BookController {

    @GetMapping("/book")
    @ResponseBody
    public String book(@ModelAttribute("book") Book book,@ModelAttribute("author") Author author) {
        return book.toString() + ">>>>>" + author.toString();
    }
}
